<?php
/*=======================================================================
 Nuke-Evolution Basic: Enhanced PHP-Nuke Web Portal System
 =======================================================================*/
include_once(NUKE_BASE_DIR.'header.php');
include_once('modules/'.$module_name.'/admin/UploadMenu.php');
include_once('modules/'.$module_name.'/admin/classes/Pagination.php');
OpenTable();
$username = $_GET['username'];

$total_records = $db->sql_numrows($db->sql_query("SELECT * FROM " . $prefix . "_upload WHERE username='".$username."'"));

$page = 1;
// how many records per page
$size = 4;
// we get the current page from $_GET
if (isset($_GET['page'])){
    $page = (int) $_GET['page'];
}
// create the pagination class
$pagination = new Pagination();
$pagination->setLink("admin.php?op=Uploaduserdetail&amp;username=".$username."&amp;page=%s");
$pagination->setPage($page);
$pagination->setSize($size);
$pagination->setTotalRecords($total_records);

//hier een while lus om door al de users te gaan die afbeeldingen hebben geupload en een link naar detailpagina
echo"
	<center>
		<a href=\"".$admin_file.".php?op=Uploadusers\">[ Get back to user upload list ]</a>
	</center>
";
$result = $db->sql_query("SELECT * FROM " . $prefix . "_upload WHERE username='".$username."'" . $pagination->getLimitSql());
echo"
<h1><u>image list of user \"".$username."\":</u></h1>
<a href=\"admin.php?op=Uploaduserdetail_delete_all&amp;username=".$username."\">Delete all images from this user <img src=\"modules/Upload/display/delete.png\" alt=\"Delete this image\" border=\"0\" /></a>
<ul>
";
while($site_row = $db->sql_fetchrow($result))
{
	echo"<li>
				<img src=\"".$config['path'].$site_row['img']."\" width=\"50\" height=\"50\" alt=\"".$site_row['img']."\" border=\"0\" /> 
				".$site_row['img']." <a href=\"admin.php?op=Uploaduserdetail_delete&amp;image_id=".$site_row['id']."\"><img src=\"modules/Upload/display/delete.png\" alt=\"Delete this image\" border=\"0\" /></a>
		</li>";
}
echo"</ul><div id=\"pagination\">";
$navigation = $pagination->create_links();
echo $navigation."</div>"; // will draw our page navigation

CloseTable();
include_once(NUKE_BASE_DIR.'footer.php');
 ?>